package com.ruowei.modules.foodOrder.repository;

import com.ruowei.common.repository.BaseRepository;
import com.ruowei.modules.foodOrder.domain.AttributeOptions;
import com.ruowei.modules.foodOrder.domain.QAttributeOptions;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Optional;

/**
 * Spring Data  repository for the AttributeOptions entity.
 */
@Repository
public interface AttributeOptionsRepository extends BaseRepository<Long, AttributeOptions, QAttributeOptions> {

    void deleteAllByAttributeCodeAndOptionNameIsNot(String attributeCode, String optionName);

    List<AttributeOptions> findAllByAttributeCodeAndStatus(String attributeCode, Boolean Status);

    Optional<AttributeOptions> findOneByOptionNameAndAttributeCodeAndStatus(String optionName, String attributeCode, Boolean status);

    Optional<AttributeOptions> findFirstByOptionNameAndAttributeCode(String optionName, String attributeCode);

    Optional<AttributeOptions> findByOptionCode(String optionCode);
}
